<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="300" var="menu" scope="application"/>
<head>
    <title>lynx-job调度中心</title>
</head>
<body>
<div class="container" style="width: 90%">

    <div class="col-md-3">
        <div class="bs-sidebar hidden-print affix" role="complementary">
            <div class="list-group">
                <a href="#" class="list-group-item base-info active">调度中心</a>
                <a href="#" class="list-group-item privilege">Job部署</a>
            </div>
        </div>
    </div>

    <div class="col-md-9">
        <table class="table table-bordered table-striped" style="background-color: white">
            <tr align="center">
                <td class="success" width="40%"><h4>Name</h4></td>
                <td class="success" width="60%"><h4>Detail</h4></td>
            </tr>
            <c:forEach var="i" begin="1" end="5" step="1">
                <tr align="center">
                    <td valign="middle">
                        <b>test job(${i})</b><br/>
                        May 16, 2014 4:27:00 PM org.apache.catalina.startup.Catalina load<br>
                        INFO: Initialization processed in 965 ms<br>
                        <br/><br/>
                        <div class="input-group">
                            <input type="file" name="files" id="myjob" size="50" style="display: none"
                                   onchange="filePath.value=this.value; ">
                            <span class="input-group-addon">路径:</span>
                            <input type='text' class="form-control" id="filePath" readonly/>
                            <span class="input-group-btn">
                                <button class="btn btn-default btn-file-choose" type="button">浏览</button>
                                <button class="btn btn-default btn-file-upload" type="button">上传</button>
                            </span>
                        </div>
                        <div class="progress" style="margin-top: 10px">
                            <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0"
                                 aria-valuemax="100" style="width: 60%;">
                                <span class="sr-only">60% Complete</span>
                            </div>
                        </div>
                    </td>
                    <td valign="middle">
                        <table class="table-condensed" style="width: 100%; height: 100%">
                            <tr>
                                <td align="right" width="20%" style="padding-top: 5px; padding-bottom: 5px">创建时间</td>
                                <td width="80%"><span style="margin-left: 2%">2014-04-21 10:25:43</span></td>
                            </tr>
                            <tr>
                                <td align="right" style="padding-top: 5px; padding-bottom: 5px">执行状态</td>
                                <td><span style="margin-left: 2%">Suspend</span></td>
                            </tr>
                            <tr>
                                <td align="right" style="padding-top: 5px; padding-bottom: 5px">调度时间</td>
                                <td>
                                    <input type="text" class="input-sm form-control" style="margin-left: 2%; width: 90%" value="* * * * * ?" disabled/>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="padding-top: 5px; padding-bottom: 5px">日志</td>
                                <td>
                                    <button class="btn btn-default btn-sm" type="button" style="margin-left: 2%; width: 90%" data-toggle="modal"
                                            data-target="#logModal">View Log</button>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="padding-top: 5px; padding-bottom: 5px">操作</td>
                                <td>
                                    <div style="margin-left: 2%; width: 90%" job-id="${i}">
                                        <select class="form-control selectpicker show-tick">
                                            <option>Edit</option>
                                            <option>Execute</option>
                                            <option>Suspend</option>
                                            <option>Delete</option>
                                        </select>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </c:forEach>
        </table>

    </div>
    <ul id="pagination-demo" class="pagination-sm" style="margin-top: -5px; float: right"
        page-size="5" cur-page="1"></ul>



</div>

<div id="confirmModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header alert-danger">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="model-title"></h4>
            </div>
            <div class="modal-body" id="model-content"></div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">确认</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true">取消</button>
            </div>
        </div>
    </div>
</div>

<div id="logModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">Job Log Console Output</h4>
            </div>
            <div class="modal-body" style="overflow-y:auto; overflow-x:auto; max-height:500px;">
                May 16, 2014 4:27:00 PM org.apache.catalina.startup.Catalina load<br>
                INFO: Initialization processed in 965 ms<br>
                May 16, 2014 4:27:00 PM org.apache.catalina.core.StandardService startInternal<br>
                INFO: Starting service Catalina<br>
                May 16, 2014 4:27:00 PM org.apache.catalina.core.StandardEngine startInternal<br>
                INFO: Starting Servlet Engine: Apache Tomcat/7.0.52<br>
                log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).<br>
                log4j:WARN Please initialize the log4j system properly.<br>
                May 16, 2014 4:27:09 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom<br>
                INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [292]
                milliseconds.<br>
                May 16, 2014 4:27:09 PM org.apache.catalina.startup.HostConfig deployDirectory<br>
                INFO: Deploying web application directory /Users/chris/Workspace/apache-tomcat-7/webapps/docs<br>
                May 16, 2014 4:27:09 PM org.apache.catalina.startup.HostConfig deployDirectory<br>
                INFO: Deploying web application directory /Users/chris/Workspace/apache-tomcat-7/webapps/examples<br>
                May 16, 2014 4:27:10 PM org.apache.catalina.startup.HostConfig deployDirectory<br>
                INFO: Deploying web application directory
                /Users/chris/Workspace/apache-tomcat-7/webapps/host-manager<br>
                May 16, 2014 4:27:10 PM org.apache.catalina.startup.HostConfig deployDirectory<br>
                INFO: Deploying web application directory /Users/chris/Workspace/apache-tomcat-7/webapps/manager<br>
                May 16, 2014 4:27:10 PM org.apache.catalina.startup.HostConfig deployDirectory<br>
                INFO: Deploying web application directory /Users/chris/Workspace/apache-tomcat-7/webapps/ROOT<br>
                May 16, 2014 4:27:10 PM org.apache.coyote.AbstractProtocol start<br>
                INFO: Starting ProtocolHandler ["http-bio-8080"]<br>
                May 16, 2014 4:27:10 PM org.apache.coyote.AbstractProtocol start<br>
                INFO: Starting ProtocolHandler ["ajp-bio-8009"]<br>
                May 16, 2014 4:27:10 PM org.apache.catalina.startup.Catalina start<br>
                INFO: Server startup in 9675 ms
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/biz/job_center.js"></script>

</body>